import { createRouter, createWebHistory } from "vue-router"

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/auth',
      component: () => import('@/views/Auth.vue')
    },
    {
      path: '/',
      component: () => import('@/views/Index.vue'),
      children: [
        {
          path: '',
          redirect: '/home'
        },
        {
          path: 'home',
          component: () => import('@/views/Home.vue')
        },
        {
          path: 'classify',
          component: () => import('@/views/Classify.vue')
        },
        {
          path: 'creation',
          component: () => import('@/views/Creation.vue')
        },
        {
          path: 'feedback',
          component: () => import('@/views/Feedback.vue')
        }
      ]
    },
    {
      path: '/editor/:id?',
      component: () => import('@/views/Editor.vue')
    },
    {
      path: '/read/:id',
      component: () => import('@/views/Read.vue')
    }
  ]
})

export default router